I tried to add a div which contains an asp:Label on
a button click event.
The following code which I used. CODE
string htmlString = "<div><asp:Label
ID=\"l1\" runat=\"server\"
Text=\"WELCOME\"></asp:Label></div>";
Panel1.Controls.Add(new LiteralControl(htmlString));
But I am not able to view that particular div.
Please try to solve me this.
Thanks in advance.
Mark Devid
08-Jan-2015Adding the markup for a server control like that will not process the server control but simply will put that markup in the produced HTML
You can use a HTmlGenericControl to do that